const func = async () => {
    let promise = new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve('执行')
        }, 1000)
    })

    console.log(await promise);
    console.log(await 0);
    console.log(await Promise.resolve(1));
    console.log(2);
    return Promise.resolve(3)
}

func().then(val => {
    console.log(val);
})


let getTime = (seconds) => {
    return new Promise(res => {
        setTimeout(() => {
            res(seconds)
        }, seconds)
    })
}

async function test() {
    let arr = [getTime(2000), getTime(500), getTime(1000)]
    for await (let x of arr) {
        console.log(x);
    }
}
test()


let s = '历历在目皑皑白雪'
let arr = []
for(let i = 0; i < s.length; i++) {
    if(s[i] == s[i+1]) {
    console.log(i);

        let res = s.slice(i, i+2)
        arr.push(res)
    }
}

console.log(arr);